/**
 * 
 */
//菜单栏切换
let workLis = document.querySelectorAll('.work-right')
let arrLis = document.querySelectorAll('.option')
for (let i = 0; i < arrLis.length; i++) {
    arrLis[i].addEventListener('click', function () {
        document.querySelector('.slide').classList.remove('slide')
        this.classList.add('slide')
        document.querySelector('.block').classList.remove('block')
        workLis[i].classList.add('block')
    })
}
//删用户
let del = document.querySelectorAll('[name=delete]')
let tbody = document.querySelector('#addstudent')
tbody.addEventListener('click', (e) => {
    if (e.target.tagName === 'A') {
        if (e.target.dataset.id === '0') {
            alert('您无法删除，请获取更高权限再试')
            return
         }
        del[e.target.dataset.id].click()
    }
})
//删图书
let bookdelete = document.querySelectorAll('[name=del]')
let tbook = document.querySelector('#addbook')
tbook.addEventListener('click', (e) => {
    if (e.target.tagName === 'A') {
        if (e.target.dataset.id === '0') {
           alert('您无法删除，请获取更高权限再试')
           return
        }
        bookdelete[e.target.dataset.id].click()
    }
})